#ifndef __FIFO_CTRL_H
#define __FIFO_CTRL_H
#include "stm32g4xx.h"

#define FIFO_LEN 5120

typedef struct{
	float	data[FIFO_LEN][2];
	uint16_t size;
	volatile uint16_t len;
	volatile uint16_t	head;
	volatile uint16_t	tail;
}POS_FIFO_Struct;	

void pos_fifo_init(POS_FIFO_Struct* fifo);
uint8_t pos_fifo_read(POS_FIFO_Struct* fifo,float *round,float *vel);
uint8_t pos_fifo_write(POS_FIFO_Struct* fifo,float round,float vel);
void pos_fifo_empty(POS_FIFO_Struct* fifo);

#endif
